import Service from "./Service";
import style from "./style.module.css";
import PolicyCard from "@/components/PolicyCard/PolicyCard";
import {Link} from "react-router-dom";
export default class PolicyDeclare extends Service{
    render = () => {
        let {activeId,policyList}=this.state;
        return (
            <div className={style.PolicyDeclare}>
                <div className={style.tabs_bar}>
                    <div className={style.title_bar}>
                        <div className={style.title}>
                            政策申报
                        </div>
                        <Link to={"/declaration_hall"} className={style.more}>更多{">"}</Link>
                    </div>
                    <div className={style.icon_bar}>
                        <div onClick={()=>{
                            this.setState({activeId:1});
                            this.setPolicyList(1);
                            }} className={style.icon}>
                        <img src={require("../../../../assect/image/declare_select_list.png")} alt="" />
                        {activeId==1 ? <div className={style.bottom_line}></div> : ""}
                        </div>
                        <div onClick={()=>{
                            this.setState({activeId:2});
                            this.setPolicyList(2);
                            }} className={style.icon}>
                        <img src={require("../../../../assect/image/declare_select_list1.png")} alt="" />
                        {activeId==2 ? <div className={style.bottom_line}></div> : ""}
                        </div>
                        <div onClick={()=>{
                            this.setState({activeId:3});
                            this.setPolicyList(3);
                            }} className={style.icon}>
                        <img src={require("../../../../assect/image/declare_select_list2.png")} alt="" />
                        {activeId==3 ? <div className={style.bottom_line}></div> : ""}
                        </div>
                    </div>
                </div>
                <div className={style.tabs_content}>
                    <div className={style.list}>
                        {
                            policyList.map((item,index)=><PolicyCard key={index} history={this.props.history} policyItem={item} />)
                        }
                    </div>
                </div>
            </div>
        )
    }
}